<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>书籍展示</title>
    <%--bootstrp样式--%>
    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
  <div class="container">
      <div class="row clearfix">
          <div class="col-md-12 colum">
              <div class="page-header">
                  <h1>
                      <small>书籍列表</small>
                  </h1>
              </div>
          </div>
          <div class="row">
              <div class="col-md-4 column">
                  <a class="btn btn-primary" href="${pageContext.request.contextPath}/book/toAddBook">新增书籍</a>
                  <a class="btn btn-primary" href="${pageContext.request.contextPath}/book/allBook">显示全部书籍</a>
              </div>
              <div class="col-md-4 column"></div>
              <div class="col-md-4 column" style="float: right">
                 <%-- <form class="form-inline" action="${pageContext.request.contextPath}/book/queryBook" method="post">
                      <span style="color: #ff0000;font-weight: bold">${err}</span>
                      <input type="text" name="queryBookName" placeholder="请输入图书名称" class="form-control" />
                      <input type="submit" value="查询" class="btn btn-primary"/>
                  </form>--%>
              </div>
          </div>
      </div>

      <div class="row clearfix">
          <div class="col-md-12 colum">
              <table class="table table-hover table-striped">
                  <thead>
                   <tr>
                       <th>书籍编号 </th>
                       <th>书籍名称 </th>
                       <th>书籍数量 </th>
                       <th>书籍详情 </th>
                       <th>操作</th>
                   </tr>
                  </thead>
                  <%--从数据库中查询数据--%>
                  <tbody>
                    <c:forEach var="book" items="${list}">
                        <tr>
                            <td>${book.bookID}</td>
                            <td>${book.bookName}</td>
                            <td>${book.bookCounts}</td>
                            <td>${book.detail}</td>
                            <td>
                                <a class="btn btn-primary" href="${pageContext.request.contextPath}/book/deleteBook/${book.bookID}">删除</a> &nbsp;|&nbsp;
                                <a class="btn btn-primary" href="${pageContext.request.contextPath}/book/toUpdatePage?id=${book.bookID}">修改</a>
                            </td>
                        </tr>
                    </c:forEach>
                  </tbody>
              </table>
          </div>
      </div>
  </div>

</body>
</html>
